/* =========================
   1. PARAMÈTRES GÉNÉRAUX
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #263247;
    background-color: #f5f8f4;
    line-height: 1.7;
}

a {
    text-decoration: none;
}


/* =========================
   2. EN-TÊTE
========================= */

.entete {
    width: 100%;
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background-color: #c2e091;
    border-bottom: 1px solid #e7ebf0;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo_site {
    width: 165px;
    height: 60px;
    object-fit: contain;
}

.nav_links ul {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.link {
    display: inline-block;
    color: #263247;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.link:hover,
.link.active {
    color: #176b38;
}


/* =========================
   3. CONTENEUR PRINCIPAL
========================= */

.conteneur {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}


/* =========================
   4. PRÉSENTATION DU MODULE
========================= */

.presentation {
    padding: 35px;
    margin-bottom: 35px;
    background-color: white;
    border-radius: 14px;
    border-left: 6px solid #176b38;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.surtitre {
    color: #176b38;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
}

.presentation h1 {
    margin: 10px 0;
    font-size: 32px;
    line-height: 1.3;
}

.description {
    max-width: 800px;
    color: #596579;
}


/* =========================
   5. ORGANISATION DU COURS
========================= */

.zone-cours {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 25px;
}


/* =========================
   6. SOMMAIRE
========================= */

.sommaire {
    padding: 25px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.sommaire h2 {
    margin-top: 0;
    color: #176b38;
}

.texte-sommaire {
    color: #697386;
    font-size: 14px;
}

.chapitre-lien {
    display: block;
    padding: 12px 14px;
    margin-top: 10px;
    color: #263247;
    background-color: #f5f8f4;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: 0.3s ease;
}

.chapitre-lien:hover,
.chapitre-lien.active {
    background-color: #e5f2d6;
    color: #176b38;
    border-left-color: #176b38;
}


/* =========================
   7. CONTENU DES CHAPITRES
========================= */

.contenu-cours {
    min-width: 0;
    padding: 35px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.contenu-cours h2 {
    margin-top: 0;
    color: #176b38;
    font-size: 27px;
}

.contenu-cours h3 {
    margin-top: 30px;
    color: #263247;
}

.contenu-cours p {
    text-align: justify;
}

.contenu-cours ul {
    padding-left: 25px;
}

.contenu-cours li {
    margin-bottom: 8px;
}

.encadre {
    margin: 25px 0;
    padding: 20px;
    background-color: #edf6e5;
    border-left: 4px solid #176b38;
    border-radius: 6px;
}

.encadre strong {
    color: #176b38;
}


/* =========================
   8. PIED DE PAGE
========================= */

.pied-page {
    margin-top: 40px;
    padding: 25px;
    text-align: center;
    background-color: #263247;
    color: white;
}


/* =========================
   9. RESPONSIVE
========================= */

@media (max-width: 800px) {

    .entete {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .nav_links ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .zone-cours {
        grid-template-columns: 1fr;
    }

    .presentation,
    .contenu-cours {
        padding: 22px;
    }

    .presentation h1 {
        font-size: 25px;
    }

    .conteneur {
        width: 92%;
        padding-top: 25px;
    }
}



/* =========================
   10. PAGINATION DU COURS
   (à coller à la FIN de chapitres.css)
========================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e7ebf0;
}

.pagination-numero {
    color: #176b38;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

.fleche {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 6px;
    font-size: 46px;
    line-height: 1;
    color: white;
    background-color: #176b38;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 107, 56, 0.25);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.fleche:hover:not(:disabled) {
    background-color: #115229;
    transform: scale(1.08);
}

.fleche:focus-visible {
    outline: 3px solid #c2e091;
    outline-offset: 3px;
}

.fleche:disabled {
    background-color: #d5dbd2;
    box-shadow: none;
    cursor: not-allowed;
}

@media (max-width: 800px) {
    .fleche {
        width: 54px;
        height: 54px;
        font-size: 38px;
    }
}

/* =========================
   11. CONTENU ENRICHI DU COURS
   (à coller à la FIN de chapitres.css, après la pagination)
========================= */

/* Petits titres (1.2.1, 1.2.2...) */
.contenu-cours h4 {
    margin: 24px 0 8px;
    color: #176b38;
    font-size: 18px;
}

/* Listes imbriquées */
.contenu-cours ul ul,
.contenu-cours ol ul,
.contenu-cours ul ol {
    margin-top: 8px;
}

.contenu-cours ol {
    padding-left: 25px;
}

/* ---------- Tableaux ---------- */
.tableau-defilant {
    margin: 22px 0;
    overflow-x: auto;
    border: 1px solid #dde6d6;
    border-radius: 10px;
}

.tableau-cours {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.tableau-cours caption {
    caption-side: top;
    padding: 12px 14px;
    text-align: left;
    font-weight: bold;
    color: #176b38;
}

.tableau-cours th {
    padding: 11px 13px;
    text-align: left;
    color: #176b38;
    background-color: #e5f2d6;
}

.tableau-cours td {
    padding: 11px 13px;
    vertical-align: top;
    border-top: 1px solid #edf1e9;
}

.tableau-cours tbody tr:nth-child(even) {
    background-color: #f8faf6;
}

.tableau-cours td:first-child {
    font-weight: bold;
    color: #263247;
}

/* ---------- Formule ---------- */
.formule {
    margin: 20px 0;
    padding: 16px 18px;
    overflow-x: auto;
    text-align: center;
    font-family: "Cambria Math", Cambria, Georgia, serif;
    font-size: 19px;
    background-color: #f5f8f4;
    border-left: 4px solid #176b38;
    border-radius: 6px;
}

/* ---------- Schémas ---------- */
.schema {
    margin: 26px 0;
    padding: 18px;
    background-color: #f8faf6;
    border: 1px solid #dde6d6;
    border-radius: 12px;
}

.schema figcaption {
    margin-top: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #176b38;
}

.schema img,
.schema-svg svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Schéma « étapes qui s'enchaînent » */
.flux {
    max-width: 520px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    counter-reset: etape;
}

.flux li {
    position: relative;
    margin: 0 0 26px;
    padding: 12px 14px 12px 54px;
    background-color: white;
    border: 2px solid #176b38;
    border-radius: 10px;
    counter-increment: etape;
}

.flux li::before {
    content: counter(etape);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background-color: #176b38;
    border-radius: 50%;
}

.flux li:not(:last-child)::after {
    content: "▼";
    position: absolute;
    left: 50%;
    bottom: -24px;
    transform: translateX(-50%);
    font-size: 15px;
    color: #176b38;
}

.flux li:last-child {
    margin-bottom: 0;
}

/* Schéma « classification » */
.arbre {
    text-align: center;
}

.arbre-racine {
    display: inline-block;
    max-width: 100%;
    padding: 12px 20px;
    font-weight: bold;
    color: white;
    background-color: #176b38;
    border-radius: 10px;
}

.arbre-branches {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.arbre-branches::before {
    content: "";
    position: absolute;
    top: -22px;
    left: 50%;
    height: 22px;
    border-left: 2px solid #176b38;
}

.arbre-branche {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    background-color: #e5f2d6;
    border: 1px solid #176b38;
    border-radius: 10px;
}

.arbre-branche strong {
    color: #176b38;
    font-size: 15px;
}

/* Barre de niveaux (satisfaisant / acceptable / insatisfaisant) */
.echelle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.echelle-segment {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 10px;
    text-align: center;
    font-size: 14px;
    border-radius: 8px;
}

.echelle-segment.niveau-bon {
    background-color: #d9efc3;
    border: 1px solid #176b38;
}

.echelle-segment.niveau-moyen {
    background-color: #fdeccb;
    border: 1px solid #c98a12;
}

.echelle-segment.niveau-mauvais {
    background-color: #f7d6d3;
    border: 1px solid #b3392f;
}

@media (max-width: 800px) {
    .schema {
        padding: 12px;
    }
}


/* =========================
   12. CHEMIN DE NAVIGATION
   (à coller à la FIN de chapitres.css)
========================= */

.fil-ariane {
    margin-bottom: 18px;
    font-size: 14px;
}

.fil-ariane ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fil-ariane li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #596579;
}

.fil-ariane li+li::before {
    content: "›";
    color: #9aa6b8;
}

.fil-ariane a {
    color: #176b38;
    font-weight: 600;
}

.fil-ariane a:hover {
    text-decoration: underline;
}

.fil-ariane [aria-current] {
    color: #263247;
    font-weight: bold;
}


/* =========================
   13. MINI-QUIZ
========================= */

.quiz {
    margin-top: 40px;
    padding: 24px;
    background-color: #f5f8f4;
    border: 1px solid #dde6d6;
    border-radius: 12px;
}

.quiz h3 {
    margin-top: 0;
    color: #176b38;
}

.quiz-intro {
    color: #596579;
    font-size: 15px;
}

.quiz-question {
    margin: 0 0 24px;
    padding: 0;
    border: none;
}

.quiz-question legend {
    padding: 0;
    margin-bottom: 10px;
    font-weight: bold;
}

.quiz-choix {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 11px 14px;
    text-align: left;
    font: inherit;
    color: #263247;
    background-color: white;
    border: 2px solid #dde6d6;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.quiz-choix:hover:not(:disabled) {
    background-color: #edf6e5;
    border-color: #176b38;
}

.quiz-choix:focus-visible {
    outline: 3px solid #c2e091;
    outline-offset: 2px;
}

.quiz-choix:disabled {
    color: #263247;
    cursor: default;
}

.quiz-choix.juste {
    background-color: #d9efc3;
    border-color: #176b38;
}

.quiz-choix.faux {
    background-color: #f7d6d3;
    border-color: #b3392f;
}

.quiz-retour {
    margin: 10px 0 0;
    font-size: 15px;
    text-align: left;
}

.quiz-score {
    margin-top: 10px;
    font-weight: bold;
    color: #176b38;
    font-size: 17px;
}

.quiz-recommencer {
    padding: 10px 20px;
    font: inherit;
    font-weight: bold;
    color: white;
    background-color: #176b38;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quiz-recommencer:hover {
    background-color: #115229;
}

@media (max-width: 800px) {
    .quiz {
        padding: 16px;
    }
}